package edu.sctu.jsoup.service;

import edu.sctu.jsoup.entity.StudentEntity;
import edu.sctu.jsoup.repo.StudentRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service//表示注入该对象StudentService
public class StudentService {
    @Autowired//IoC自动注入功能，替换以前的set写法.数据库与程序之前的连接
    private StudentRepo studentRepo;
    public void run(){
        StudentEntity chen = new StudentEntity();
        chen.setName("乘");
        chen.setAge(20);
        studentRepo.save(chen);
    }
}
